c
c -- file name gx2phs.htm 030100
C**** SUBROUTINE GXLATG is called from group 13, GREX3, and entered
C only when the patch name begins with the characters 'LATG', and
C only for VAL=GRND10, i.e. ISC=22.
C
C.... The library cases W901-W902 make use of it.
C
SUBROUTINE GXLATG
INCLUDE 'farray'
INCLUDE 'grdloc'
INCLUDE 'satgrd'
INCLUDE 'satear'
COMMON/IGE/IXF,IXL,IYF,IYL,IREG,NZSTEP,IGR,ISC,IRUN,IZSTEP,ITHYD,
1 ISWEEP,ISTEP,INDVAR,VAL,CO,NDIREC,WALDIS,PATGEO,IGES20(6)
INTEGER VAL,CO,WALDIS,PATGEO
COMMON/NAMFN/NAMFUN,NAMSUB
CHARACTER*6 NAMFUN,NAMSUB
C
NAMSUB = 'GXLATG'
IF(ISC.EQ.22) THEN
c fn101(y,x,a) y is solution of x = (y-0.5*sin(2.0*y))/pi, where
c a (=hgsoa) is simply an iteration-cut-off
c criterion, used in a sequence which calculates
c the cross-sectional area of the water-filled
c part of the pipe from the volume fraction.
CALL FN101(VAL,R2,HGSOA)
c fn102(y,x,a,b,c) y = a*b*(c**3)*(.6666*(sinx)**3
c -cosx*(x-0.5*sin2x))
c a (=buoya) is the gravitational acceleration;
c b (=hgsob) carries the density difference;
c c (=yvlast) is the radius of the pipe.
CALL FN102(VAL,VAL,BUOYA,HGSOB,YVLAST)
c fn103(y,x,idir) this subroutine puts x(next)-x into y, where
c 'next' is the next value in the north, south,
c east or west direction, indicated by
c idir (ilatga) =1,2,3 or 4.
CALL FN103(VAL,VAL,ILATGA)
ENDIF
NAMSUB = 'gxlatg'
END
c